package sharedb

import (
	"gorm.io/gorm"
)

type User struct {
	Id     int64 `gorm:"column:id"`
	Server int16 `gorm:"column:server"`
}

func (user *User) TableName() string {
	return "user"
}

func (user *User) GetByModel(Conn *gorm.DB) error {
	result := Conn.Where("Id = ?", user.Id).Find(&user)
	if result.Error != nil {
		return result.Error
	}
	return nil
}
